package com.qiangesoft.rdp.starter.mvc.exception.result;

/**
 * 业务异常枚举
 *
 * @author qiangesoft
 * @date 2023-09-18
 */
public enum ResultMessageEnum implements ExceptionResultHandler {

    /***********基础响应码***********/

    SUCCESS(200, "请求成功"),

    FAIL(500, "请求失败"),

    /***********常规响应码***********/

    PARAM_ERROR(4001, "请求参数错误"),

    PARAM_TYPE_ERROR(4002, "参数类型错误"),

    MESSAGE_NOT_READABLE(4003, "参数不可读"),

    BODY_MEDIA_TYPE_NOT_SUPPORT(4004, "请求体MediaType不支持"),

    UNAUTHORIZED(4011, "用户未登录"),

    FORBIDDEN(4031, "权限不足"),

    NOT_FOUND(4041, "请求资源不存在"),

    METHOD_NOT_ALLOWED(4051, "请求方式不正确"),

    INTERNAL_SERVER_ERROR(5001, "服务器内部错误，请稍后再试");

    private int code;

    private String message;

    ResultMessageEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
